<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <title>装备列表</title>
                <link href="__PUBLIC__/css/select.css" rel="stylesheet" type="text/css" />
                <link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" />
                <script type="text/javascript" src="__PUBLIC__/js/jquery-1.9.0.min.js"></script>
                <script type="text/javascript" src="__PUBLIC__/js/jquery.idTabs.min.js"></script>
                <script type="text/javascript" src="__PUBLIC__/js/select-ui.min.js"></script>
                <script type="text/javascript" src="__PUBLIC__/js/editor/kindeditor.js"></script>
                <script type="text/javascript" src="__PUBLIC__/js/layer/layer.js"></script>

                <script type="text/javascript">
                        /*                
                         KE.show({
                         id: 'content7',
                         cssPath: './index.css'
                         });
                         */
                </script>

                <script type="text/javascript">
                        $(document).ready(function(e) {
                                $(".select1").uedSelect({
                                        width: 345
                                });
                                $(".select2").uedSelect({
                                        width: 167
                                });
                                $(".select3").uedSelect({
                                        width: 200
                                });
                        });

                        function queryEquipmentList() {
                                var equipment_class_id = $("#equipment_category_select").find("option:selected").val();
                                if (equipment_class_id == 0) {
                                        layer.msg("请选择装备分类");
                                        return;
                                }
//                                query_equipment_list
                                $.ajax({
                                        type: "GET",
                                        url: "{:U('Equipment/query_equipment_list')}",
                                        data: {equipment_class_id: equipment_class_id},
                                        dataType: "json",
                                        success: function(data) {
                                                //每次显示新数据前清除旧数据
                                                $("#equipmentListTable").find('tbody').empty();
                                                if (data.length > 0) {
                                                        for (var i = 0; i < data.length; i++) {
                                                                //alert(msg[i].code);
                                                                var firstTr = $("#equipmentListTable").find('tbody>tr:first');
                                                                var row = $("<tr></tr>");

                                                                var td1 = $("<td></td>");
                                                                td1.append($("<input name='' type='checkbox' value='' />"));

                                                                var td2 = $("<td></td>");
                                                                td2.append(data[i].equipments_name);

                                                                //装备是否是精品
                                                                var td3 = $("<td></td>");
                                                                if (data[i].is_refinement = 1) {
                                                                        td3.append("是");
                                                                } else {
                                                                        td3.append("否");
                                                                }

                                                                //装备是否热门
                                                                var td4 = $("<td></td>");
                                                                if(data[i].is_hot == 1){
                                                                        td4.append("是");
                                                                }else{
                                                                        td4.append("否");
                                                                }
                                                                

                                                                var td5 = $("<td></td>");
                                                                td5.append(data[i].add_date);

                                                                var td6 = $("<td></td>");
                                                                td6.append(data[i].equipments_brand);

                                                                var td7 = $("<td></td>");
                                                                td7.append(data[i].looked_num);

                                                                var td8 = $("<td></td>");
                                                                td8.append($("<a href='#' class='tablelink'>查看</a>     <a href='#' class=tablelink'> 删除</a>"));

                                                                row.append(td1);
                                                                row.append(td2);
                                                                row.append(td3);
                                                                row.append(td4);
                                                                row.append(td5);
                                                                row.append(td6);
                                                                row.append(td7);
                                                                row.append(td8);
                                                                $("#equipmentListTable").append(row);
                                                        }
                                                } else {
                                                        layer.msg('没有数据', {shift: 6});
                                                }
                                        }
                                });

                        }
                </script>
        </head>

        <body>

                <div class="place">
                        <span>位置：</span>
                        <ul class="placeul">
                                <li><a href="#">首页</a></li>
                                <li><a href="#">装备管理</a></li>
                                <li><a href="#">装备列表</a></li>
                        </ul>
                </div>

                <div class="formbody">
                        <div id="usual1" class="usual"> 

                                <div class="itab">
                                        <ul> 
                                                <li><a href="#tab1" class="selected">装备列表</a></li> 
                                        </ul>
                                </div> 

                                <div id="tab2" class="tabson">
                                        <ul class="seachform">
                                                <li><label>装备分类</label>  
                                                        <div class="vocation">
                                                                <select class="select3" name="equipment_category" id='equipment_category_select'>
                                                                        <option value="0">请选择</option>
                                                                        <volist name="equipment_class_list" id="vo">
                                                                                <option value="{$vo.id}">{$vo.categoryname}</option>
                                                                        </volist>
                                                                </select>
                                                        </div>
                                                </li>

                                                <li>
                                                        <label>&nbsp;</label>
                                                        <input name="" onclick="queryEquipmentList()" type="button" class="scbtn" value="查询"/>
                                                </li>
                                        </ul>
                                        <table class="tablelist" id="equipmentListTable">
                                                <thead>
                                                        <tr>
                                                                <th><input name="" type="checkbox" value="" checked="checked"/></th>
                                                                <th>装备名称<!--equipments_name--><i class="sort"><img src="__APP__/Public/images/px.gif" /></i></th>
                                                                <th>是否精品<!--is_refinement--></th>
                                                                <th>是否热门<!--is_hot--></th>
                                                                <th>上传日期<!--add_date--></th>
                                                                <th>品牌<!--equipments_brand--></th>
                                                                <th>看过此装备的人数<!--looked_num--></th>
                                                                <th>操作</th>
                                                        </tr>
                                                </thead>
                                                <tbody>
                                                        <!--
                                                        <tr>
                                                                <td><input name="" type="checkbox" value="" /></td>
                                                                <td>20130908</td>
                                                                <td>王金平幕僚：马英九声明字字见血 人活着没意思</td>
                                                                <td>admin</td>
                                                                <td>江苏南京</td>
                                                                <td>2013-09-09 15:05</td>
                                                                <td>已审核</td>
                                                                <td><a href="#" class="tablelink">查看</a>     <a href="#" class="tablelink"> 删除</a></td>
                                                        </tr> 
                                                        -->
                                                </tbody>
                                        </table>
                                </div>  
                        </div> 
                        <script type="text/javascript">
                                $("#usual1 ul").idTabs();
                        </script>

                        <script type="text/javascript">
                                $('.tablelist tbody tr:odd').addClass('odd');
                        </script>
                </div>
        </body>
</html>
